import { Link, Outlet, useNavigate } from 'react-router-dom';

export default function Home() {
  const navigate = useNavigate();
  console.log('=================', navigate);
  return (
    <div>
      <div>我是首页</div>
      <div>首页的导航</div>
      <button onClick={()=>navigate('/cart')}>购物车</button>
      <button onClick={()=>navigate('/cart?day=30')}>购物车query</button>
      <hr />
      <ul>
        <li>
          <Link to="/">热销</Link>
        </li>
        <li>
          <Link to="/fast">抢购</Link>
        </li>
      </ul>
      <hr />
      <Outlet />
    </div>
  );
}
